package com.bub.pay.outer.redis.sms;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.LinkedHashMap;

@Service("chuanlanSender")
public class ChuanlanSender implements SmsSender {

	private static final Logger log = LoggerFactory.getLogger(ChuanlanSender.class);
	
	@Autowired
	private SmsProperties smsProperties;

	@Override
	public boolean sendSms(String mobile, String templateId, LinkedHashMap<String, String> map) throws Exception {
//		Map<String, Object> reqMap = new HashMap<>();
//		reqMap.put("account", smsProperties.getAppKey());
//		reqMap.put("password", smsProperties.getAppSecret());
//		reqMap.put("msg", SmsTemplate.getContent(templateId, smsProperties.getAppSign()));
//		if (map != null && map.size() > 0) {
//			reqMap.put("params", mobile + "," + String.join(",", map.values().toArray(new String[] {})));
//			log.info(HttpHelper.postMethod(smsProperties.getVarUrl(), reqMap));
//		}else {
//			reqMap.put("phone", mobile);
//			log.info(HttpHelper.postMethod(smsProperties.getDefUrl(), reqMap));
//		}
		return true;
	}

	@Override
	public boolean sendVoiceSms(String mobile, String templateId, LinkedHashMap<String, String> map) throws Exception {
		// TODO Auto-generated method stub
		return true;
	}

}
